<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>OOP in PHP</title>
<?php include("comment-service-adapter.php"); ?>
</head>
<body>
<?php

$adapter = new CommentServiceAdapter();
$code = $adapter->Post($_POST['aid'], $_POST['comment']);

if ($code == 0) {
  echo '{code:0, reason:"Post Comment OK"}';
} else {
  echo '{code:1, reason:"提交评论失败"}';
}

?>
</body>
</html>

